﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TulingMember.Database.Migrations.Migrations
{
    public partial class updateproducttables : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Balance",
                table: "cts_Supplier");

            migrationBuilder.DropColumn(
                name: "EndNum",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "SubNum",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "Weight",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "CustomerBalance",
                table: "cts_PurchaseOrder");

            migrationBuilder.DropColumn(
                name: "Weight",
                table: "cts_PurchaseOrder");

            migrationBuilder.RenameColumn(
                name: "CustomerName",
                table: "cts_PurchaseOrder",
                newName: "SupplierName");

            migrationBuilder.RenameColumn(
                name: "CustomerId",
                table: "cts_PurchaseOrder",
                newName: "SupplierId");

            migrationBuilder.AddColumn<DateTime>(
                name: "ExpirationDate",
                table: "cts_PurchaseOrderDetail",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<string>(
                name: "Formulations",
                table: "cts_PurchaseOrderDetail",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "GuoyaoZhunzi",
                table: "cts_PurchaseOrderDetail",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Manufacturer",
                table: "cts_PurchaseOrderDetail",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "ManufacturingDate",
                table: "cts_PurchaseOrderDetail",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<string>(
                name: "Formulations",
                table: "cts_Product",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SearchCode",
                table: "cts_Product",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "StockLowerLimit",
                table: "cts_Product",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "StockUpperLimit",
                table: "cts_Product",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.UpdateData(
                table: "Role",
                keyColumn: "Id",
                keyValue: 142307070910554L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 17, 15, 6, 17, 771, DateTimeKind.Unspecified).AddTicks(3087), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "Security",
                keyColumn: "Id",
                keyValue: 142307070910555L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 17, 15, 6, 17, 771, DateTimeKind.Unspecified).AddTicks(4486), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "Security",
                keyColumn: "Id",
                keyValue: 142307070910556L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 17, 15, 6, 17, 771, DateTimeKind.Unspecified).AddTicks(4494), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "Security",
                keyColumn: "Id",
                keyValue: 142307070910557L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 17, 15, 6, 17, 771, DateTimeKind.Unspecified).AddTicks(4496), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "User",
                keyColumn: "Id",
                keyValue: 142307070910551L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 17, 15, 6, 17, 772, DateTimeKind.Unspecified).AddTicks(543), new TimeSpan(0, 8, 0, 0, 0)));
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ExpirationDate",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "Formulations",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "GuoyaoZhunzi",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "Manufacturer",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "ManufacturingDate",
                table: "cts_PurchaseOrderDetail");

            migrationBuilder.DropColumn(
                name: "Formulations",
                table: "cts_Product");

            migrationBuilder.DropColumn(
                name: "SearchCode",
                table: "cts_Product");

            migrationBuilder.DropColumn(
                name: "StockLowerLimit",
                table: "cts_Product");

            migrationBuilder.DropColumn(
                name: "StockUpperLimit",
                table: "cts_Product");

            migrationBuilder.RenameColumn(
                name: "SupplierName",
                table: "cts_PurchaseOrder",
                newName: "CustomerName");

            migrationBuilder.RenameColumn(
                name: "SupplierId",
                table: "cts_PurchaseOrder",
                newName: "CustomerId");

            migrationBuilder.AddColumn<decimal>(
                name: "Balance",
                table: "cts_Supplier",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<int>(
                name: "EndNum",
                table: "cts_PurchaseOrderDetail",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SubNum",
                table: "cts_PurchaseOrderDetail",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Weight",
                table: "cts_PurchaseOrderDetail",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "CustomerBalance",
                table: "cts_PurchaseOrder",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "Weight",
                table: "cts_PurchaseOrder",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.UpdateData(
                table: "Role",
                keyColumn: "Id",
                keyValue: 142307070910554L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 15, 14, 41, 53, 452, DateTimeKind.Unspecified).AddTicks(9611), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "Security",
                keyColumn: "Id",
                keyValue: 142307070910555L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 15, 14, 41, 53, 453, DateTimeKind.Unspecified).AddTicks(1039), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "Security",
                keyColumn: "Id",
                keyValue: 142307070910556L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 15, 14, 41, 53, 453, DateTimeKind.Unspecified).AddTicks(1049), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "Security",
                keyColumn: "Id",
                keyValue: 142307070910557L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 15, 14, 41, 53, 453, DateTimeKind.Unspecified).AddTicks(1051), new TimeSpan(0, 8, 0, 0, 0)));

            migrationBuilder.UpdateData(
                table: "User",
                keyColumn: "Id",
                keyValue: 142307070910551L,
                column: "CreatedTime",
                value: new DateTimeOffset(new DateTime(2023, 6, 15, 14, 41, 53, 453, DateTimeKind.Unspecified).AddTicks(7787), new TimeSpan(0, 8, 0, 0, 0)));
        }
    }
}
